Ext.define('TS.view.bible.verse.Grid' , {
	extend: 'TS.lib.Grid',
	alias : 'widget.versegrid',
	tbar:Factory.toolbar.search([{
		name:'book_id',
		xtype:'combo',
		store:Dict.book,
		onSelect:function(){
			Util.s.load(Util.cmp('versegrid combo[name=chapter_id]').getStore(), simpleWhere('book_id', this.getValue()));
		},
		empty:'Księga'
	},{
		name:'chapter_id',
		xtype:'combo',
		store:Ext.clone(Dict.chapter),
		empty:'Rozdział'
	}]),
	frame:false,
	store: 'Verse',
	columns: [
	 	{xtype: 'rownumberer'},{
			header:'ID',
			hidden:true,
			dataIndex:'verse_id'
		},{
			header:'Numer',
			sortable:true,
			dataIndex:'verse_number'
		},{
			header:'Book',
			renderer:Factory.rend.dict(Dict.book),
			dataIndex:'book_id'
		},{
			header:'Rozdział',
			renderer:Factory.rend.dict(Dict.chapter),
			dataIndex:'chapter_id'
		}
	]
});